<template>
  <div class="wall-message">
    <div class="header">
      <div class="title">
        <div class="name">{{ cardObj && cardObj.title }}</div>
        <div class="slogan">{{ cardObj && cardObj.slogan }}</div>
      </div>
      <div class="list">
        <span
          v-for="(item, index) in cardObj && cardObj.children"
          :key="index"
          :class="selectValue === item.value ? 'selected' : 'label'"
          @click="selectTab(item)"
        >
          {{ item.label }}
        </span>
      </div>
      <div class="note">
        <note-card></note-card>
        <note-card></note-card>
      </div>
    </div>
  </div>
</template>

<script>
import { inject, ref } from "vue";
import NoteCard from "@/components/NoteCard.vue";
export default {
  components: { NoteCard },
  setup(props) {
    console.log("props", props);
    const cardObj = inject("cardObj");
    let selectValue = ref(11);
    function selectTab(item) {
      selectValue.value = item.value;
    }
    return {
      cardObj,
      selectValue,
      selectTab,
    };
  },
};
</script>

<style lang="less" scoped>
.wall-message {
  padding: 0px 56px;
  display: flex;
  flex-direction: column;
  position: relative;
  .header {
    display: flex;
    flex-direction: column;
    align-items: center;

    .title {
      padding: 46px 0 40px;
      .name {
        font-weight: 600;
        font-size: 56px;
        color: #202020;
        text-align: center;
      }
    }
    .slogan {
      padding-top: 8px;
      color: #5b5b5b;
      font-size: @size-14;
    }
    .list {
      padding-bottom: 26px;
      display: flex;
      height: 30px;
      line-height: 30px;
      width: 100%;
      align-items: center;
      justify-content: center;
      .label {
        display: inline-block;
        font-weight: 400;
        font-size: 14px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 14px;
        color: #5b5b5b;
        padding: 0px 16px;
        height: 28px;
        line-height: 28px;
        margin-right: 20px;
        cursor: pointer;
      }
      .selected {
        border: 1px solid #202020;
        border-radius: 14px;
        color: #202020;
        font-weight: 600;
        font-size: 14px;
        padding: 0px 16px;
        height: 28px;
        line-height: 28px;
        margin-right: 20px;
        cursor: pointer;
      }
    }
  }
  .note {
    display: flex;
    flex-wrap: wrap;
    justify-content: start;
    width: 1050px;
  }
}
</style>
